/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vn.webapp.form;

/**
 *
 * @author Tonytran
 */
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.NumberFormat;
import org.springframework.format.annotation.NumberFormat.Style;

/*
 * Using a customization validator
 */

public class CourseValidationForm {

    
    @NotEmpty
    private String code;
    
    @NotEmpty
    private String name;

    @NotNull
    @NumberFormat(style = Style.NUMBER)
    @Min(1)
    @Max(100)
    private int credits;
    
    private int id;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getCredits() {
        return credits;
    }

    public void setCredits(int credits) {
        this.credits = credits;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    
}